<template>
  <div class="department">
 <div class="col-md-4">
   <div class="score">
     <h3>健康度</h3>
     <div>{{data.time}}天内系统安全评分<i class="iconfont icon-help"></i></div>
     <button>查看扣分项</button>
   </div>
   <div class="healthNumber">
     <span>{{data.score}}</span>
     <span>分</span>
   </div>
 </div>
 <div class="col-md-4 malfunction">
   <div class="malfunctionTitle">故障</div>
   <div class="col-md-6">
     <span>{{data.faultPending}}</span><br/>
     <span>待处理</span>
   </div>
   <div class="col-md-6">
     <span>{{data.faultProcessed}}</span><br/>
     <span>已处理</span>
   </div>
 </div>
 <div class="col-md-4 malfunction">
   <div class="malfunctionTitle">风险</div>
   <div class="col-md-6">
     <span>{{data.riskPending}}</span><br/>
     <span>待处理</span>
   </div>
   <div class="col-md-6">
     <span>{{data.riskProcessed}}</span><br/>
     <span>已处理</span>
   </div>
 </div>
</div>
</template>
<script>
import BS from '../dataManage';
export default {
  data () {
    return {
      data:{}
    }
  },
  props:{
    'msg':{
      type:String
    },
    'url':{
      type:String
    }
  },
  ready(){
    BS.getHealthData.call(this,this.url,this.msg)
  },
  watch:{
    'msg':function(){
      BS.getHealthData.call(this,this.url,this.msg)
    }
  }
}
</script>
<style scoped>
div.healthNumber{
  padding-top: 48px;
  display: inline-block;
}
div.healthNumber span:first-child{
  font-size: 92px;
}
div.department h3{
  margin-bottom: 4px;
  letter-spacing: 6px;
  margin-top: 0;
}
div.department button{
  background: rgba(221, 221, 221,0.4);
  outline: none;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 13px;
  margin-top: 6px;
}
div.department {
  padding:16px 24px;
  color: #fff;
  width: 100%;
  height: 150px;
  background-color: red;
  float: left;
  margin-top: 25px;
  border-radius: 10px;
  filter:alpha(opacity=100 finishopacity=50 style=1 startx=0,starty=0,finishx=0,finishy=150) progid:DXImageTransform.Microsoft.gradient(startcolorstr=red,endcolorstr=blue,gradientType=0);
  -ms-filter:alpha(opacity=100 finishopacity=50 style=1 startx=0,starty=0,finishx=0,finishy=150) progid:DXImageTransform.Microsoft.gradient(startcolorstr=red,endcolorstr=blue,gradientType=0);/*IE8*/  
  background:#20d4cd; /* 一些不支持背景渐变的浏览器 */  
  background:-moz-linear-gradient(left, #20d4cd, #8ce990);  
  background:-webkit-gradient(linear, 0 0, right bottom, from(#20d4cd), to(#8ce990));  
  background:-o-linear-gradient(left, #20d4cd, #8ce990);
}
.malfunction .malfunctionTitle{
  text-align: center;
  font-size: 16px;
  position: relative;
  margin-bottom: 24px;
  margin-top: 8px;
}
.malfunction .malfunctionTitle:before{
  content: '';
  width: 38%;
  height: 1px;
  background-color: #eeeeee;
  position: absolute;
  left:58%;
  top: 10px;
}
.malfunction .malfunctionTitle:after{
  content: '';
  width: 38%;
  height: 1px;
  background-color: #eeeeee;
  position: absolute;
  right: 58%;
  top: 10px;
}
.malfunction .col-md-6{
  text-align: center;
} 
.malfunction .col-md-6 span:first-child{
  font-size: 32px;
}
.score{
  display: inline-block;
}
.score i{
    vertical-align: middle;
    margin-left: 4px;
    margin-right: 16px;
}
</style>
